<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<style type="text/css">
     table{
         border: 3px solid #ccc;
         border-collapse: collapse;
         margin:auto;
     }
     
     table th ,table td{
          border:1px solid #ccc;
     }
     
</style>
</head>
<body>
     <center>
        <h2>员工列表</h2>
     </center>
       <table>
           <tr>
              <th>姓名</th>
              <th>性别</th>
              <th>年龄</th>
              <th>薪资</th>
              <th>部门</th>
              <th>经理</th>
              <th>操作</th>
           </tr>
           <c:forEach items="${es}"  var="e">
             <tr>
              <td>
              <a href='${pageContext.request.contextPath}/emp/details?empno=${e.empno}'>${e.ename}</a>
              </td>
              <td>${e.esex}</td>
              <td>${e.eage}</td>
              <td>${e.esalary}</td>
              <td>${e.dept.dname}</td>
              <td>${e.mgr.ename}</td>
              <td>
                <a href='#'>删除</a>
                <a href='#'>更新</a>
              </td>
           </tr>
           </c:forEach>
       </table>
       <p style='text-align: center;'>
         <!-- 通过Controller转发跳转到添加员工页面 -->
          <a href="${pageContext.request.contextPath}/emp/toAdd">添加员工</a>
       </p>
      
</body>
</html>